public class BaseDemo {
    private String baseName = "base";
    public BaseDemo() {
        callName();
    }
    public void callName() {
        System.out.println(baseName);
    }
    static class Sub extends BaseDemo {
        private String baseName = "sub";

        public void callName() {
            System.out.println(baseName);
        }
    }
    public static void main(String[] args) {
        BaseDemo b = new Sub();
    }
}
